import request from '@/utils/request'

/**
 * 点赞文章
 */
export function likeArticle(articleId) {
  return request({
    url: `/article/likeArticle/${articleId}`,
    method: 'post'
  })
}


/**
 * 文章详情
 */
export function ArticleDetail(articleId) {
  return request({
    url: `/home/detail/${articleId}`,
    method: 'get'
  })
}

/**
 * 评论文章
 */
export function addBookComment(data) {
  return request({
    url: `/article/addBookComment`,
    method: 'post',
    data
  })
}

/**
 * 回复评论
 */
export function replyComment(data) {
  return request({
    url: `/article/replyComment`,
    method: 'post',
    data
  })
}


/**
 * 发布文章
 */
export function addArticle(data) {
  return request({
    url: `/article/save`,
    method: 'post',
    data
  })
}

/**
 * 我的文章
 */
export function myArticles(params) {
  return request({
    url: `/article/myArticles`,
    method: 'get',
    params
  })
}

/**
 * 修改文章
 */
export function updateArticle(data) {
  return request({
    url: `/article/update`,
    method: 'post',
    data
  })
}